﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using WindowsInput.Native;
using System.Collections.ObjectModel;

namespace UniPie
{
	/// <summary>
	/// Defines a slice in a pie menu. It is used to drive the PieSlice custom controls.
	/// </summary>
	public class SliceDefinition
	{
		/// <summary>
		/// Was meant to store the index if the slice. Currently unused.
		/// </summary>
		public int Index { get; set; }

		/// <summary>
		/// If true then the slice is enabled and can send a key/mouse combo.
		/// </summary>
		public bool IsEnabled { get; set; }

		/// <summary>
		/// The text shown on the slice.
		/// </summary>
		public string Text { get; set; }

		/// <summary>
		/// The hue of the slice background.
		/// </summary>
		public double Hue { get; set; }

		/// <summary>
		/// The saturation of the slice background.
		/// </summary>
		public double Saturation { get; set; }

		/// <summary>
		/// The key/mouse combo which should be sent when the slice is executed.
		/// </summary>
		public ObservableCollection<VirtualKeyCode> ComboToSend { get; set; }

		public SliceDefinition()
		{
			Index = -1;
			IsEnabled = true;
			Text = "?";
			Hue = 0;
			Saturation = 0.0;
			ComboToSend = new ObservableCollection<VirtualKeyCode>();
		}

		/// <summary>
		/// Deep copy constructor.
		/// </summary>
		public SliceDefinition(SliceDefinition sd)
		{
			Index = sd.Index;
			IsEnabled = sd.IsEnabled;
			Text = sd.Text;
			Hue = sd.Hue;
			Saturation = sd.Saturation;
			ComboToSend = new ObservableCollection<VirtualKeyCode>(sd.ComboToSend);
		}

		public SliceDefinition(int TheSliceIndex, bool TheIsEnabled, string TheText, double TheHue, double TheSaturation, ObservableCollection<VirtualKeyCode> TheComboToSend)
		{
			Index = TheSliceIndex;
			IsEnabled = TheIsEnabled;
			Text = TheText;
			Hue = TheHue;
			Saturation = TheSaturation;
			ComboToSend = TheComboToSend;
		}
	}
}
